package corej.course.thread;

public class TestThread {
    public static void main(String[] args) {
        Thread t1 = new Thread1();
        Thread t2 = new Thread2();

        t1.setPriority(1);
        t2.setPriority(10);

        Runnable target = new Target();
        Thread t3 = new Thread(target);

        t1.start();
        t2.start();
        t3.start();
    }
}

class Thread1 extends Thread {
    public void run() {
        for (int i = 1; i <= 1000; i++) {
            System.out.println(i + "  $$$");
        }
    }
}

class Thread2 extends Thread {
    public void run() {
        for (int i = 1; i <= 1000; i++) {
            System.out.println(i + " ###");
        }
    }
}

class Target implements Runnable {
    public void run() {
        for (int i = 1; i <= 1000; i++) {
            System.out.println(i + " @@@");
        }
    }
}
